#! /usr/bin/python3
# -*- coding: utf-8 -*-
# __author__ = "Fengxuewei"
# Date: 2020/6/20

from bs4 import BeautifulSoup
import requests

url = 'https://m.58.com/bj/pbdn/?reform=pcfront'
headers = {
    'User-Agent':'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1'
}
wb_data = requests.get(url, headers=headers)
soup = BeautifulSoup(wb_data.text,'lxml')

titles = soup.select('#new_infoList p')
prices = soup.select('div.clearfix.price  ')
zones = soup.select('a > div > div > div.clearfix.detail > span.fl ')

print(zones)

for title,price,zone in zip(titles,prices,zones):
    print(title.text, price.text,zone)
#jingzhun > tbody > tr:nth-child(1) > td.vertop-es > b
#jingzhun > tbody > tr:nth-child(1) > td.vertop-es > b
#new_infoList > li:nth-child(1) > a > div > div > div.clearfix.price > span:nth-child(1)
#jingzhun > tbody > tr:nth-child(1) > td.vertop-es
#jingzhun > tbody > tr:nth-child(3) > td.vertop-es > b
#new_infoList > li:nth-child(1) > a > div > div > p
#new_infoList > li:nth-child(1) > a > div > div
#new_infoList > li:nth-child(1) > a > div > div > div.clearfix.detail > span.fl